<template>
  <div class="jiayi-container">
    <Header/>
    <main class="main flex1" ref="main">
      <jiayi-home ref="home_ref"/>
    </main>
  </div>
</template>

<script>
import jiayiHome from "@/views/jiayi/home";
import Header from "@/views/jiayi/header";
import {decodeBase64, isNotEmpty, isNotEmptyStr} from "@/utils/zzDouUtils/objUtil";


export default {
  name: "Jiayi",
  components: {Header,jiayiHome},
  computed: {
  },
  data() {
    return {
      doc: {
        headerBackground: null,
      },
      open: false,
      pageInfo:{/* 页面相关参数 */
        active: 'home',//当前页面 home首页、product产品页、product_info产品详情页、news_moment新闻页
        productType: null,
        product: null,
        newsType: null,
        news: null,
      },
      logoImgUrl: require('@/assets/images/logo.png'),
      logo2ImgUrl: require('@/assets/images/logo2.png'),
    };
  },
  mounted() {},
  created() {
    this.init()
  },
  beforeRouteUpdate(to, from, next) {
    this.init();
    next();
  },
  methods: {
    init(){
      this.$nextTick(()=>{
        let query = this.$route.query;
        if (isNotEmpty(query) && isNotEmptyStr(query.r)){
          this.$refs.home_ref.scrollIntoView(decodeBase64(query.r))
        }
      })
    }
  }
};
</script>

<style scoped>
[v-cloak] {
  display: none;
}
.main{
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

</style>
